<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Frontend_Pages extends Controller_Frontend {
	
	public function action_view()
	{
		$view = new View('frontend/pages.view');
		
		$unique = Request::current()->param('page');
		
		$page = ORM::factory('Page')->where('unique', '=', $unique)->find();
		$view->page = $page;
		
		if (empty($page->id))
			throw new HTTP_Exception_404;
		
		$this->template->content = $view;
	}
	
}